<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>CruiseControl.NET : Dynamic Parameters</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            CruiseControl.NET : Dynamic Parameters
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Jul 25, 2009 by <font color="#0050B2">csut017</font>.
				    </div>

				    <h3><a name="DynamicParameters-DynamicParameters"></a>Dynamic Parameters</h3>

<p>Starting with CruiseControl.NET 1.5.0, it is possible to define dynamic parameters for a project. These parameters are values that are set at build time, as opposed to being hard-coded within the configuration file.</p>

<h3><a name="DynamicParameters-DefiningParameters"></a>Defining Parameters</h3>

<p>Parameters are defined at the project-level. Each parameter must be defined here - if you try to use a parameter that is not defined you will get a runtime error&#33;</p>

<p>The following parameters are defined:</p>
<ul><li><a href="Boolean Parameter.html" title="Boolean Parameter">Boolean Parameter</a></li><li><a href="Date Parameter.html" title="Date Parameter">Date Parameter</a></li><li><a href="Numeric Parameter.html" title="Numeric Parameter">Numeric Parameter</a></li><li><a href="Select Parameter.html" title="Select Parameter">Select Parameter</a></li><li><a href="Text Parameter.html" title="Text Parameter">Text Parameter</a></li></ul>

<h4><a name="DynamicParameters-SystemParameters"></a>System Parameters</h4>

<p>As well as custom parameters, a number of parameters are defined by the system. These are the same as the <a href="Integration Properties.html" title="Integration Properties">Integration Properties</a>. To use one of these parameters, prefix it with a $, e.g. $CCNetBuildCondition.</p>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Label </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Example </th>
<th class='confluenceTh'> Version </th>
</tr>
<tr>
<td class='confluenceTd'> CCNetBuildCondition </td>
<td class='confluenceTd'> The condition used to trigger the build, indicating if the build was triggered by new modifications or if it was forced.  Legal values are: "IfModificationExists" or "ForceBuild" </td>
<td class='confluenceTd'> ForceBuild </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> CCNetIntegrationStatus </td>
<td class='confluenceTd'> The status of the current integration. Could be Success, Failure, Exception or Unknown </td>
<td class='confluenceTd'> Success </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> CCNetLabel </td>
<td class='confluenceTd'> The label used to identify the CCNet build.  This label is generated by the CCNet labeller. </td>
<td class='confluenceTd'> 1.0.2.120 </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> CCNetLastIntegrationStatus </td>
<td class='confluenceTd'> The status of the previous integration. Could be Success, Failure, Exception or Unknown </td>
<td class='confluenceTd'> Success </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> CCNetProject </td>
<td class='confluenceTd'> The name of the CCNet project that is being integrated. </td>
<td class='confluenceTd'> MyProject </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> CCNetBuildDate </td>
<td class='confluenceTd'> The date of the build (in yyyy-MM-dd format) </td>
<td class='confluenceTd'> 2005-08-10 </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> CCNetBuildTime </td>
<td class='confluenceTd'> The time of the start of the build (in HH:mm:ss format) </td>
<td class='confluenceTd'> 08:45:12 </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> CCNetArtifactDirectory </td>
<td class='confluenceTd'> The <a href="Project Configuration Block.html#ProjectConfigurationBlock-artifactDirectory">project artifact directory</a> (as an absolute path) </td>
<td class='confluenceTd'> <tt>c:\program files\CruiseControl.NET\Server\MyProject\Artifacts</tt> </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> CCNetWorkingDirectory </td>
<td class='confluenceTd'> The <a href="Project Configuration Block.html#ProjectConfigurationBlock-workingDirectory">project working directory</a> (as an absolute path) </td>
<td class='confluenceTd'> <tt>c:\program files\CruiseControl.NET\Server\MyProject\WorkingDirectory</tt> </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> CCNetRequestSource </td>
<td class='confluenceTd'> The source of the integration request; this will generally be the name of the trigger that raised the request. </td>
<td class='confluenceTd'> IntervalTrigger </td>
<td class='confluenceTd'> 1.1.0 </td>
</tr>
<tr>
<td class='confluenceTd'> CCNetFailureUsers </td>
<td class='confluenceTd'> The list of users who have contributed modifications to a sequence of builds that has failed. </td>
<td class='confluenceTd'> John, Smith<br clear="all" /> </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> CCNetListenerFile </td>
<td class='confluenceTd'> <a href="http://confluence.public.thoughtworks.org/display/CCNETCOMM/Viewing+build+progress+with+Nant+and+MSBuild">Viewing build progress with Nant and MSBuild</a> </td>
<td class='confluenceTd'> c:\Project\Artifact\listener.xml </td>
<td class='confluenceTd'> 1.4.0 </td>
</tr>
<tr>
<td class='confluenceTd'> CCNetProjectUrl </td>
<td class='confluenceTd'> The URL where the project is located </td>
<td class='confluenceTd'> <a href="http://myhost/ccnet/server/">http://myhost/ccnet/server/</a> </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> CCNetNumericLabel </td>
<td class='confluenceTd'> Contains the label as an integer if conversion is possible, otherwise zero. </td>
<td class='confluenceTd'> 1 </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> CCNetModifyingUsers <br clear="all" /> </td>
<td class='confluenceTd'> The list of users who have contributed to the current build only <br clear="all" /> </td>
<td class='confluenceTd'> Smith </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'> CCNetUser </td>
<td class='confluenceTd'> The user who forced the build. If security is off, or the build is not forced, then this will not be set. </td>
<td class='confluenceTd'> John Doe </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
</tbody></table>

<h3><a name="DynamicParameters-UsingParameters"></a>Using Parameters</h3>

<p>Parameters are used at the task/publisher level. They cannot be used in any other project elements.</p>

<p>Using parameters can be done in one of two ways: configuration definition or implied replacement.</p>

<p><b>Note:</b> Not all tasks/publishers allow the use of dynamic parameters. To be able to use the parameters a task must expose a dynamicValues element.</p>

<h4><a name="DynamicParameters-ConfigurationDefinition"></a>Configuration Definition</h4>

<p>In this approach the parameter usage is defined within the configuration file. This is generally the more complex approach, but it provides better control over how the parameters are applied.</p>

<p>To us this approach a dynamicValues element must be added to the task/publisher:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;dynamicValues&gt;</span>
  <span class="code-tag">&lt;directValue&gt;</span>
    <span class="code-tag">&lt;property&gt;</span>buildArgs<span class="code-tag">&lt;/property&gt;</span>
    <span class="code-tag">&lt;parameter&gt;</span>BuildArgs<span class="code-tag">&lt;/parameter&gt;</span>
    <span class="code-tag">&lt;default&gt;</span>-t:Dev<span class="code-tag">&lt;/default&gt;</span>
  <span class="code-tag">&lt;/directValue&gt;</span>
<span class="code-tag">&lt;/dynamicValues&gt;</span></pre>
</div></div>
<p>The following dynamic values are defined:</p>
<ul><li><a href="Direct Dynamic Value.html" title="Direct Dynamic Value">Direct Dynamic Value</a></li><li><a href="Replacement Dynamic Value.html" title="Replacement Dynamic Value">Replacement Dynamic Value</a></li></ul>

<h4><a name="DynamicParameters-ImpliedReplacement"></a>Implied Replacement</h4>

<p>In this approach the parameters are defined inline in the properties. When the configuration is loaded, CruiseControl.NET reads these parameters and converts them into dynamicValues (as above).</p>

<p>An inline definition is contained with a $[...] block and can consist of one or more parts seperated by pipe characters. The first part is the parameter name, the second part is the default value and the third part is the format (only used when a replacementValue is generated).</p>

<p>Some examples are:</p>
<ul>
	<li>&lt;buildArgs&gt;<b>$[BuildArgs]</b>&lt;/buildArgs&gt; - use the BuildArgs parameter as a direct replacement, if omitted then the value will be empty.</li>
	<li>&lt;buildArgs&gt;<b>$[BuildArgs&#124;-t:Dev]</b>&lt;/buildArgs&gt; - use the BuildArgs parameter as a direct replacement, if omitted then the value will be "-t:Dev".</li>
	<li>&lt;buildArgs&gt;-t:<b>$[BuildType&#124;Dev]</b> &#45;ll:<b>$[LogLevel&#124;50&#124;00]</b>&lt;/buildArgs&gt; - a replacementValue will be generated using the two parameters - the second parameter will use the "00" format.</li>
	<li>&lt;buildArgs&gt;-t:<b>$[$CCNetBuildCondition]</b> &#45;ll:<b>$[LogLevel&#124;50&#124;00]</b>&lt;/buildArgs&gt; - a replacementValue will be generated that uses the system parameter of CCNetBuildCondition and a custom parameter called LogLevel.</li>
</ul>


<h3><a name="DynamicParameters-Examples"></a>Examples</h3>

<p>Here are some examples of how to use dynamic values and parameters in a project. For each example, the following basic project template is used:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;project name=<span class="code-quote">"Test Project"</span>&gt;</span>
  <span class="code-tag">&lt;description&gt;</span>A demonstration project to show the features of the dynamic build parameters.<span class="code-tag">&lt;/description&gt;</span>
  <span class="code-tag">&lt;sourcecontrol type=<span class="code-quote">"svn"</span>&gt;</span>
    <span class="code-tag">&lt;trunkUrl&gt;</span>svn://svn.mycompany.com/firstproject/trunk<span class="code-tag">&lt;/trunkUrl&gt;</span>
    <span class="code-tag">&lt;workingDirectory&gt;</span>C:\SourceControl\FirstProject\<span class="code-tag">&lt;/workingDirectory&gt;</span>
  <span class="code-tag">&lt;/sourcecontrol&gt;</span>
  <span class="code-tag">&lt;triggers&gt;</span>
    <span class="code-tag">&lt;intervalTrigger /&gt;</span>
  <span class="code-tag">&lt;/triggers&gt;</span>
  <span class="code-tag">&lt;tasks&gt;</span>
    <span class="code-tag">&lt;nant&gt;</span>
      <span class="code-tag">&lt;buildFile&gt;</span>App.build<span class="code-tag">&lt;/buildFile&gt;</span>
      <span class="code-tag">&lt;targetList&gt;</span>
        <span class="code-tag">&lt;target&gt;</span>Dev<span class="code-tag">&lt;/target&gt;</span>
      <span class="code-tag">&lt;/targetList&gt;</span>
      <span class="code-tag">&lt;buildArgs&gt;</span>-D:reason=testing<span class="code-tag">&lt;/buildArgs&gt;</span>
    <span class="code-tag">&lt;/nant&gt;</span>
    <span class="code-tag">&lt;gendarme&gt;</span>
      <span class="code-tag">&lt;assemblies&gt;</span>
        <span class="code-tag">&lt;assemblyMatch expr=<span class="code-quote">"*.dll"</span>/&gt;</span>
      <span class="code-tag">&lt;/assemblies&gt;</span>
      <span class="code-tag">&lt;limit&gt;</span>100<span class="code-tag">&lt;/limit&gt;</span>
    <span class="code-tag">&lt;/gendarme&gt;</span>
  <span class="code-tag">&lt;/tasks&gt;</span>
  <span class="code-tag">&lt;publishers&gt;</span>
    <span class="code-tag">&lt;rss /&gt;</span>
    <span class="code-tag">&lt;xmllogger /&gt;</span>
  <span class="code-tag">&lt;/publishers&gt;</span>
<span class="code-tag">&lt;/project&gt;</span></pre>
</div></div>

<h4><a name="DynamicParameters-DefiningaBuildTarget"></a>Defining a Build Target</h4>

<p>In this example, a single select parameter is being used to set the build target. The user can choose from one of the predefined values:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;project name=<span class="code-quote">"Test Project"</span>&gt;</span>
  <span class="code-tag">&lt;description&gt;</span>A demonstration project to show the features of the dynamic build parameters.<span class="code-tag">&lt;/description&gt;</span>
  <span class="code-tag">&lt;sourcecontrol type=<span class="code-quote">"svn"</span>&gt;</span>
    <span class="code-tag">&lt;trunkUrl&gt;</span>svn://svn.mycompany.com/firstproject/trunk<span class="code-tag">&lt;/trunkUrl&gt;</span>
    <span class="code-tag">&lt;workingDirectory&gt;</span>C:\SourceControl\FirstProject\<span class="code-tag">&lt;/workingDirectory&gt;</span>
  <span class="code-tag">&lt;/sourcecontrol&gt;</span>
  <span class="code-tag">&lt;triggers&gt;</span>
    <span class="code-tag">&lt;intervalTrigger /&gt;</span>
  <span class="code-tag">&lt;/triggers&gt;</span>
  <span class="code-tag">&lt;tasks&gt;</span>
    <span class="code-tag">&lt;nant&gt;</span>
      <span class="code-tag">&lt;buildFile&gt;</span>App.build<span class="code-tag">&lt;/buildFile&gt;</span>
      <span class="code-tag">&lt;targetList&gt;</span>
        <span class="code-tag">&lt;target&gt;</span>$[buildType|DEV]<span class="code-tag">&lt;/target&gt;</span>
      <span class="code-tag">&lt;/targetList&gt;</span>
      <span class="code-tag">&lt;buildArgs&gt;</span>-D:reason=testing<span class="code-tag">&lt;/buildArgs&gt;</span>
    <span class="code-tag">&lt;/nant&gt;</span>
    <span class="code-tag">&lt;gendarme&gt;</span>
      <span class="code-tag">&lt;assemblies&gt;</span>
        <span class="code-tag">&lt;assemblyMatch expr=<span class="code-quote">"*.dll"</span>/&gt;</span>
      <span class="code-tag">&lt;/assemblies&gt;</span>
      <span class="code-tag">&lt;limit&gt;</span>100<span class="code-tag">&lt;/limit&gt;</span>
    <span class="code-tag">&lt;/gendarme&gt;</span>
  <span class="code-tag">&lt;/tasks&gt;</span>
  <span class="code-tag">&lt;publishers&gt;</span>
    <span class="code-tag">&lt;rss /&gt;</span>
    <span class="code-tag">&lt;xmllogger /&gt;</span>
  <span class="code-tag">&lt;/publishers&gt;</span>
  <span class="code-tag">&lt;parameters&gt;</span>
    <span class="code-tag">&lt;selectParameter name=<span class="code-quote">"buildType"</span>&gt;</span>
      <span class="code-tag">&lt;allowedValues&gt;</span>
        <span class="code-tag">&lt;value name=<span class="code-quote">"Development"</span>&gt;</span>DEV<span class="code-tag">&lt;/value&gt;</span>
        <span class="code-tag">&lt;value name=<span class="code-quote">"Test"</span>&gt;</span>TEST<span class="code-tag">&lt;/value&gt;</span>
        <span class="code-tag">&lt;value name=<span class="code-quote">"Production"</span>&gt;</span>PROD<span class="code-tag">&lt;/value&gt;</span>
      <span class="code-tag">&lt;/allowedValues&gt;</span>
    <span class="code-tag">&lt;/selectParameter&gt;</span>
  <span class="code-tag">&lt;/parameters&gt;</span>
<span class="code-tag">&lt;/project&gt;</span></pre>
</div></div>

<h4><a name="DynamicParameters-SettingaNumericLimit"></a>Setting a Numeric Limit</h4>

<p>In this example, a numeric parameter is used to limit the number of errors that is reported by then Gendarme task:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;project name=<span class="code-quote">"Test Project"</span>&gt;</span>
  <span class="code-tag">&lt;description&gt;</span>A demonstration project to show the features of the dynamic build parameters.<span class="code-tag">&lt;/description&gt;</span>
  <span class="code-tag">&lt;sourcecontrol type=<span class="code-quote">"svn"</span>&gt;</span>
    <span class="code-tag">&lt;trunkUrl&gt;</span>svn://svn.mycompany.com/firstproject/trunk<span class="code-tag">&lt;/trunkUrl&gt;</span>
    <span class="code-tag">&lt;workingDirectory&gt;</span>C:\SourceControl\FirstProject\<span class="code-tag">&lt;/workingDirectory&gt;</span>
  <span class="code-tag">&lt;/sourcecontrol&gt;</span>
  <span class="code-tag">&lt;triggers&gt;</span>
    <span class="code-tag">&lt;intervalTrigger /&gt;</span>
  <span class="code-tag">&lt;/triggers&gt;</span>
  <span class="code-tag">&lt;tasks&gt;</span>
    <span class="code-tag">&lt;nant&gt;</span>
      <span class="code-tag">&lt;buildFile&gt;</span>App.build<span class="code-tag">&lt;/buildFile&gt;</span>
      <span class="code-tag">&lt;targetList&gt;</span>
        <span class="code-tag">&lt;target&gt;</span>Dev<span class="code-tag">&lt;/target&gt;</span>
      <span class="code-tag">&lt;/targetList&gt;</span>
      <span class="code-tag">&lt;buildArgs&gt;</span>-D:reason=testing<span class="code-tag">&lt;/buildArgs&gt;</span>
    <span class="code-tag">&lt;/nant&gt;</span>
    <span class="code-tag">&lt;gendarme&gt;</span>
      <span class="code-tag">&lt;assemblies&gt;</span>
        <span class="code-tag">&lt;assemblyMatch expr=<span class="code-quote">"*.dll"</span>/&gt;</span>
      <span class="code-tag">&lt;/assemblies&gt;</span>
      <span class="code-tag">&lt;limit&gt;</span>$[GendarmeLimit|100]<span class="code-tag">&lt;/limit&gt;</span>
    <span class="code-tag">&lt;/gendarme&gt;</span>
  <span class="code-tag">&lt;/tasks&gt;</span>
  <span class="code-tag">&lt;publishers&gt;</span>
    <span class="code-tag">&lt;rss /&gt;</span>
    <span class="code-tag">&lt;xmllogger /&gt;</span>
  <span class="code-tag">&lt;/publishers&gt;</span>
  <span class="code-tag">&lt;parameters&gt;</span>
    <span class="code-tag">&lt;numericParameter name=<span class="code-quote">"GendarmeLimit"</span>&gt;</span>
      <span class="code-tag">&lt;description&gt;</span>The limit of Gendarme errors.<span class="code-tag">&lt;/description&gt;</span>
      <span class="code-tag">&lt;minimum&gt;</span>50<span class="code-tag">&lt;/minimum&gt;</span>
      <span class="code-tag">&lt;maximum&gt;</span>500<span class="code-tag">&lt;/maximum&gt;</span>
      <span class="code-tag">&lt;default&gt;</span>100<span class="code-tag">&lt;/default&gt;</span>
    <span class="code-tag">&lt;/numericParameter&gt;</span>  
  <span class="code-tag">&lt;/parameters&gt;</span>
<span class="code-tag">&lt;/project&gt;</span></pre>
</div></div>

<h4><a name="DynamicParameters-ConfiguringtheBuildTask"></a>Configuring the Build Task</h4>

<p>In this example, all the values of the build task can be configured - this includes a combination of both direct and replacement dynamic values:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;cruisecontrol&gt;</span>
  <span class="code-tag">&lt;project name=<span class="code-quote">"Test Project"</span>&gt;</span>
    <span class="code-tag">&lt;description&gt;</span>A demonstration project to show the features of the dynamic build parameters.<span class="code-tag">&lt;/description&gt;</span>
    <span class="code-tag">&lt;sourcecontrol type=<span class="code-quote">"svn"</span>&gt;</span>
      <span class="code-tag">&lt;trunkUrl&gt;</span>svn://svn.mycompany.com/firstproject/trunk<span class="code-tag">&lt;/trunkUrl&gt;</span>
      <span class="code-tag">&lt;workingDirectory&gt;</span>C:\SourceControl\FirstProject\<span class="code-tag">&lt;/workingDirectory&gt;</span>
    <span class="code-tag">&lt;/sourcecontrol&gt;</span>
    <span class="code-tag">&lt;triggers&gt;</span>
      <span class="code-tag">&lt;intervalTrigger /&gt;</span>
    <span class="code-tag">&lt;/triggers&gt;</span>
    <span class="code-tag">&lt;tasks&gt;</span>
      <span class="code-tag">&lt;nant&gt;</span>
        <span class="code-tag">&lt;buildFile&gt;</span>$[BuildScript|App].build<span class="code-tag">&lt;/buildFile&gt;</span>
        <span class="code-tag">&lt;targetList&gt;</span>
          <span class="code-tag">&lt;target&gt;</span>$[BuildType|DEV]<span class="code-tag">&lt;/target&gt;</span>
        <span class="code-tag">&lt;/targetList&gt;</span>
        <span class="code-tag">&lt;buildArgs&gt;</span>-D:reason=$[Reason] -D:start=$[StartDate]<span class="code-tag">&lt;/buildArgs&gt;</span>
      <span class="code-tag">&lt;/nant&gt;</span>
      <span class="code-tag">&lt;gendarme&gt;</span>
        <span class="code-tag">&lt;assemblies&gt;</span>
          <span class="code-tag">&lt;assemblyMatch expr=<span class="code-quote">"*.dll"</span>/&gt;</span>
        <span class="code-tag">&lt;/assemblies&gt;</span>
        <span class="code-tag">&lt;limit&gt;</span>100<span class="code-tag">&lt;/limit&gt;</span>
      <span class="code-tag">&lt;/gendarme&gt;</span>
    <span class="code-tag">&lt;/tasks&gt;</span>
    <span class="code-tag">&lt;publishers&gt;</span>
      <span class="code-tag">&lt;rss /&gt;</span>
      <span class="code-tag">&lt;xmllogger /&gt;</span>
    <span class="code-tag">&lt;/publishers&gt;</span>
    <span class="code-tag">&lt;parameters&gt;</span>
      <span class="code-tag">&lt;booleanParameter name=<span class="code-quote">"BuildScript"</span>&gt;</span>
        <span class="code-tag">&lt;true name=<span class="code-quote">"App"</span>&gt;</span>Yes<span class="code-tag">&lt;/true&gt;</span>
        <span class="code-tag">&lt;false name=<span class="code-quote">"FullBuild"</span>&gt;</span>No<span class="code-tag">&lt;/false&gt;</span>
        <span class="code-tag">&lt;display&gt;</span>Production Build<span class="code-tag">&lt;/display&gt;</span>
        <span class="code-tag">&lt;description&gt;</span>Do you want to generate a production build?<span class="code-tag">&lt;/description&gt;</span>
        <span class="code-tag">&lt;default&gt;</span>App<span class="code-tag">&lt;/default&gt;</span>
      <span class="code-tag">&lt;/booleanParameter&gt;</span>
      <span class="code-tag">&lt;selectParameter name=<span class="code-quote">"BuildType"</span>&gt;</span>
        <span class="code-tag">&lt;description&gt;</span>The type of build to perform.<span class="code-tag">&lt;/description&gt;</span>
        <span class="code-tag">&lt;allowedValues&gt;</span>
          <span class="code-tag">&lt;value&gt;</span>Dev<span class="code-tag">&lt;/value&gt;</span>
          <span class="code-tag">&lt;value&gt;</span>Test<span class="code-tag">&lt;/value&gt;</span>
          <span class="code-tag">&lt;value&gt;</span>Prod<span class="code-tag">&lt;/value&gt;</span>
        <span class="code-tag">&lt;/allowedValues&gt;</span>
        <span class="code-tag">&lt;default&gt;</span>Dev<span class="code-tag">&lt;/default&gt;</span>
      <span class="code-tag">&lt;/selectParameter&gt;</span>
      <span class="code-tag">&lt;textParameter name=<span class="code-quote">"Reason"</span>&gt;</span>
        <span class="code-tag">&lt;description&gt;</span>Reason for the build being forced.<span class="code-tag">&lt;/description&gt;</span>
        <span class="code-tag">&lt;minimum&gt;</span>10<span class="code-tag">&lt;/minimum&gt;</span>
        <span class="code-tag">&lt;maximum&gt;</span>255<span class="code-tag">&lt;/maximum&gt;</span>
        <span class="code-tag">&lt;required&gt;</span>true<span class="code-tag">&lt;/required&gt;</span>
      <span class="code-tag">&lt;/textParameter&gt;</span>
      <span class="code-tag">&lt;dateParameter name=<span class="code-quote">"StartDate"</span>&gt;</span>
        <span class="code-tag">&lt;default&gt;</span>Today<span class="code-tag">&lt;/default&gt;</span>
        <span class="code-tag">&lt;minimum&gt;</span>1-Jan-2000<span class="code-tag">&lt;/minimum&gt;</span>
        <span class="code-tag">&lt;maximum&gt;</span>31-Dec-2100<span class="code-tag">&lt;/maximum&gt;</span>
      <span class="code-tag">&lt;/dateParameter&gt;</span>
    <span class="code-tag">&lt;/parameters&gt;</span>
  <span class="code-tag">&lt;/project&gt;</span>
<span class="code-tag">&lt;/cruisecontrol&gt;</span></pre>
</div></div>

<p>An alternate way of defining the last example is to explicitly define the dynamic parameters in the task:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;project name=<span class="code-quote">"Test Project"</span>&gt;</span>
  <span class="code-tag">&lt;description&gt;</span>A demonstration project to show the features of the dynamic build parameters.<span class="code-tag">&lt;/description&gt;</span>
  <span class="code-tag">&lt;sourcecontrol type=<span class="code-quote">"svn"</span>&gt;</span>
    <span class="code-tag">&lt;trunkUrl&gt;</span>svn://svn.mycompany.com/firstproject/trunk<span class="code-tag">&lt;/trunkUrl&gt;</span>
    <span class="code-tag">&lt;workingDirectory&gt;</span>C:\SourceControl\FirstProject\<span class="code-tag">&lt;/workingDirectory&gt;</span>
  <span class="code-tag">&lt;/sourcecontrol&gt;</span>
  <span class="code-tag">&lt;triggers&gt;</span>
    <span class="code-tag">&lt;intervalTrigger /&gt;</span>
  <span class="code-tag">&lt;/triggers&gt;</span>
  <span class="code-tag">&lt;tasks&gt;</span>
    <span class="code-tag">&lt;nant&gt;</span>
      <span class="code-tag">&lt;buildFile&gt;</span>App.build<span class="code-tag">&lt;/buildFile&gt;</span>
      <span class="code-tag">&lt;targetList&gt;</span>
        <span class="code-tag">&lt;target&gt;</span>DEV<span class="code-tag">&lt;/target&gt;</span>
      <span class="code-tag">&lt;/targetList&gt;</span>
      <span class="code-tag">&lt;buildArgs&gt;</span>-D:reason= -D:start=<span class="code-tag">&lt;/buildArgs&gt;</span>
      <span class="code-tag">&lt;dynamicValues&gt;</span>
        <span class="code-tag">&lt;replacementValue&gt;</span>
          <span class="code-tag">&lt;format&gt;</span>{0}.build<span class="code-tag">&lt;/format&gt;</span>
          <span class="code-tag">&lt;parameters&gt;</span>
            <span class="code-tag">&lt;namedValue&gt;</span>
              <span class="code-tag">&lt;name&gt;</span>BuildScript<span class="code-tag">&lt;/name&gt;</span>
              <span class="code-tag">&lt;value&gt;</span>App<span class="code-tag">&lt;/value&gt;</span>
            <span class="code-tag">&lt;/namedValue&gt;</span>
          <span class="code-tag">&lt;/parameters&gt;</span>
          <span class="code-tag">&lt;property&gt;</span>buildFile<span class="code-tag">&lt;/property&gt;</span>
        <span class="code-tag">&lt;/replacementValue&gt;</span>
        <span class="code-tag">&lt;directValue&gt;</span>
          <span class="code-tag">&lt;default&gt;</span>DEV<span class="code-tag">&lt;/default&gt;</span>
          <span class="code-tag">&lt;parameter&gt;</span>BuildType<span class="code-tag">&lt;/parameter&gt;</span>
          <span class="code-tag">&lt;property&gt;</span>targetList/target<span class="code-tag">&lt;/property&gt;</span>
        <span class="code-tag">&lt;/directValue&gt;</span>
        <span class="code-tag">&lt;replacementValue&gt;</span>
          <span class="code-tag">&lt;format&gt;</span>-D:reason={0} -D:start={1}<span class="code-tag">&lt;/format&gt;</span>
          <span class="code-tag">&lt;parameters&gt;</span>
            <span class="code-tag">&lt;namedValue&gt;</span>
              <span class="code-tag">&lt;name&gt;</span>Reason<span class="code-tag">&lt;/name&gt;</span>
              <span class="code-tag">&lt;value /&gt;</span>
            <span class="code-tag">&lt;/namedValue&gt;</span>
            <span class="code-tag">&lt;namedValue&gt;</span>
              <span class="code-tag">&lt;name&gt;</span>StartDate<span class="code-tag">&lt;/name&gt;</span>
              <span class="code-tag">&lt;value /&gt;</span>
            <span class="code-tag">&lt;/namedValue&gt;</span>
          <span class="code-tag">&lt;/parameters&gt;</span>
          <span class="code-tag">&lt;property&gt;</span>buildArgs<span class="code-tag">&lt;/property&gt;</span>
        <span class="code-tag">&lt;/replacementValue&gt;</span>
      <span class="code-tag">&lt;/dynamicValues&gt;</span>
    <span class="code-tag">&lt;/nant&gt;</span>
    <span class="code-tag">&lt;gendarme&gt;</span>
      <span class="code-tag">&lt;assemblies&gt;</span>
        <span class="code-tag">&lt;assemblyMatch expr=<span class="code-quote">"*.dll"</span>/&gt;</span>
      <span class="code-tag">&lt;/assemblies&gt;</span>
      <span class="code-tag">&lt;limit&gt;</span>100<span class="code-tag">&lt;/limit&gt;</span>
    <span class="code-tag">&lt;/gendarme&gt;</span>
  <span class="code-tag">&lt;/tasks&gt;</span>
  <span class="code-tag">&lt;publishers&gt;</span>
    <span class="code-tag">&lt;rss /&gt;</span>
    <span class="code-tag">&lt;xmllogger /&gt;</span>
  <span class="code-tag">&lt;/publishers&gt;</span>
  <span class="code-tag">&lt;parameters&gt;</span>
    <span class="code-tag">&lt;booleanParameter name=<span class="code-quote">"BuildScript"</span>&gt;</span>
      <span class="code-tag">&lt;true name=<span class="code-quote">"App"</span>&gt;</span>Yes<span class="code-tag">&lt;/true&gt;</span>
      <span class="code-tag">&lt;false name=<span class="code-quote">"FullBuild"</span>&gt;</span>No<span class="code-tag">&lt;/false&gt;</span>
      <span class="code-tag">&lt;display&gt;</span>Production Build<span class="code-tag">&lt;/display&gt;</span>
      <span class="code-tag">&lt;description&gt;</span>Do you want to generate a production build?<span class="code-tag">&lt;/description&gt;</span>
      <span class="code-tag">&lt;default&gt;</span>App<span class="code-tag">&lt;/default&gt;</span>
    <span class="code-tag">&lt;/booleanParameter&gt;</span>
    <span class="code-tag">&lt;selectParameter name=<span class="code-quote">"BuildType"</span>&gt;</span>
      <span class="code-tag">&lt;description&gt;</span>The type of build to perform.<span class="code-tag">&lt;/description&gt;</span>
      <span class="code-tag">&lt;allowedValues&gt;</span>
        <span class="code-tag">&lt;value&gt;</span>Dev<span class="code-tag">&lt;/value&gt;</span>
        <span class="code-tag">&lt;value&gt;</span>Test<span class="code-tag">&lt;/value&gt;</span>
        <span class="code-tag">&lt;value&gt;</span>Prod<span class="code-tag">&lt;/value&gt;</span>
      <span class="code-tag">&lt;/allowedValues&gt;</span>
      <span class="code-tag">&lt;default&gt;</span>Dev<span class="code-tag">&lt;/default&gt;</span>
    <span class="code-tag">&lt;/selectParameter&gt;</span>
    <span class="code-tag">&lt;textParameter name=<span class="code-quote">"Reason"</span>&gt;</span>
      <span class="code-tag">&lt;description&gt;</span>Reason for the build being forced.<span class="code-tag">&lt;/description&gt;</span>
      <span class="code-tag">&lt;minimum&gt;</span>10<span class="code-tag">&lt;/minimum&gt;</span>
      <span class="code-tag">&lt;maximum&gt;</span>255<span class="code-tag">&lt;/maximum&gt;</span>
      <span class="code-tag">&lt;required&gt;</span>true<span class="code-tag">&lt;/required&gt;</span>
    <span class="code-tag">&lt;/textParameter&gt;</span>
    <span class="code-tag">&lt;dateParameter name=<span class="code-quote">"StartDate"</span>&gt;</span>
      <span class="code-tag">&lt;default&gt;</span>Today<span class="code-tag">&lt;/default&gt;</span>
      <span class="code-tag">&lt;minimum&gt;</span>1-Jan-2000<span class="code-tag">&lt;/minimum&gt;</span>
      <span class="code-tag">&lt;maximum&gt;</span>31-Dec-2100<span class="code-tag">&lt;/maximum&gt;</span>
    <span class="code-tag">&lt;/dateParameter&gt;</span>
  <span class="code-tag">&lt;/parameters&gt;</span>
<span class="code-tag">&lt;/project&gt;</span></pre>
</div></div>

				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="http://confluence.public.thoughtworks.org//images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Sep 29, 2009 20:59</font></td>
		    </tr>
	    </table>
    </body>
</html>